/*
 * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
 *
 * https://www.mall4j.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */
package com.yami.shop.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yami.shop.bean.model.StockBillLog;
import com.yami.shop.bean.model.StockBillLogItem;
import com.yami.shop.bean.vo.StockBillLogItemImportVO;
import com.yami.shop.common.util.PageParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 出入库商品项
 *
 * @author LGH
 * @date 2021-09-09 13:11:15
 */
public interface StockBillLogItemService extends IService<StockBillLogItem> {

    /**
     * 根据出入明细id获取出入商品项列表
     * @param stockBillLogId
     * @return
     */
    List<StockBillLogItem> listByStockBillLogId(Long stockBillLogId);

    /**
     * 下载导入商品项模板
     * @param response
     * @param type
     */
    void downloadModel(HttpServletResponse response, Integer type);

    /**
     * 解析excel数据，并把商品项返回
     * @param excelFile
     * @param shopId
     * @param type 1: 出库 2: 入库
     * @return
     * @throws Exception
     */
    StockBillLogItemImportVO parseFile(MultipartFile excelFile, Long shopId, Integer type) throws Exception;

    /**
     * 查询库存流水
     * @param page
     * @param stockBillLog
     * @return
     */
    IPage<StockBillLogItem> flow(PageParam<StockBillLog> page, StockBillLog stockBillLog);

    /**
     * 导出库存流水
     * @param stockBillLog
     * @param response
     */
    void exportFlow(StockBillLog stockBillLog, HttpServletResponse response);
}
